/*
 * @Author: zwc 6537397+uni-yunApp@user.noreply.gitee.com
 * @Date: 2021-02-22 18:19:38
 * @LastEditors: zwc 6537397+uni-yunApp@user.noreply.gitee.com
 * @LastEditTime: 2023-04-13 18:33:35
 * @FilePath: \ant-design-vue-admin-master\src\store\actions.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// import { removeCookie, removeStorage, saveCookie, saveSessionStorage, saveStorage } from '@/utils/cache'
// import { ACCESS_TOKEN, LOGIN_STATUS, SETTINGS, USER_INFO } from '@/utils/constants'
import * as types from './mutationTypes'

// /**
//  * 设置登录状态
//  * @param commit
//  * @param state
//  * @param query
//  */
// export const setLoginStatus = ({ commit, state }, query) => {
//   if (!query) {
//     removeCookie(LOGIN_STATUS)
//   } else {
//     const expires = new Date(+new Date() + 24 * 60 * 60 * 1000) // 24小时过期时间
//     saveCookie(LOGIN_STATUS, query, { expires })
//   }
//   commit(types.SET_LOGIN_STATUS, query)
// }

// /**
//  * 设置token
//  * @param commit
//  * @param state
//  * @param query
//  */
// export const setAccessToken = ({ commit, state }, query) => {
//   if (!query) {
//     removeStorage(ACCESS_TOKEN)
//   } else {
//     saveStorage(ACCESS_TOKEN, query)
//   }
//   commit(types.SET_ACCESS_TOKEN, query)
// }

// /**
//  * 设置用户信息
//  * @param commit
//  * @param state
//  * @param query
//  */
// export const setUserInfo = ({ commit, state }, query) => {
//   if (!query) {
//     removeStorage(USER_INFO)
//   } else {
//     saveStorage(USER_INFO, query)
//   }
//   commit(types.SET_USER_INFO, query)
// }

/**
 * 设置
 * @param commit
 * @param state
 * @param query
 */
export const setSettings = ({ commit, state }, query) => {
  commit(types.SET_SETTINGS, query)
}
